Skip to content

Pilot plotly for the Python second-order-condition 3D figure - #660

Merged
d-morrison merged 2 commits into
mainfrom
claude/project-thread-knb6b2
Nov 5, 2026
Merged

d-morrison merged 2 commits into
mainfrom
claude/project-thread-knb6b2

Conversation

@d-morrison

Copy link
Copy Markdown
Contributor

Requested by Ezra · project thread

Closes #659.

What changed

  • /home/user/mds/_subfiles/vector-calc/_fig-second-order-condition-3d.qmd: the Python tab draws the two surfaces with plotly (make_subplots with two 3D scenes, same colors, camera and markers as the R tab) in HTML and slide output.
  • The earlier matplotlib chunk is kept as second-order-condition-3d-python-static and runs only for non-HTML output (PDF, Word), the same split the R tab already uses. No kaleido is needed.
  • optimization-critical-points.qmd and optimization.qmd add plotly to their py_require lists.

Implementation notes

  • The figure is emitted as a raw HTML block (fig.to_html(full_html=False, include_plotlyjs="cdn")) in a single print, because fig.show() needs ipython and several prints split the knitr output.
  • Trailing ; on the add_trace and update_layout calls stops reticulate from auto-printing the returned figure.
  • The CDN plotly.js loads beside the copy the R widgets bundle; both are modern and I saw no conflict in the rendered file, but I did not open the page in a browser.

Checks

  • quarto render optimization-critical-points.qmd --to html exits 0 with no div or knitr warnings (the downlit/xml2 warning is also on main); the output holds the plotly div with both scenes.
  • Not rendered: PDF, and optimization.qmd.

Generated by Claude Code

…output

The matplotlib figure stays as the static fallback for PDF and Word.
Closes #659.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019xfc9pyVsdgfFPiYDQB7ko
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

…d-call lint

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019xfc9pyVsdgfFPiYDQB7ko
@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Claude finished review — View run


I fetched PR #660 live just now. It is open, not a draft, and not merged (mergedAt is null). Its head is 18d64d2d920c291b40a3f77c674eed37fbf6efe2, the commit I reviewed, so the verdict applies to the current head.

Verdict

Ready for merge. No new findings. The prior review of 7a01ef2 (comment) also said Ready for merge, and that verdict still stands. Its two non-blocking suggestions (duplicate plotly.js load, hidden-tab sizing in the preview) are unchanged.

Structured Review Data (JSON)
{
  "schema_version": "1.1",
  "reviewer": "claude",
  "commit_sha": "18d64d2d920c291b40a3f77c674eed37fbf6efe2",
  "verdict": "CLEAN",
  "findings": [],
  "detailed_assessment": "The optimization.qmd change binds the package vector to py_packages before calling reticulate::py_require; the package list is unchanged and the name does not collide with anything else in that file.",
  "holistic_assessment": "The commit is a lint-only refactor with no behavior change, so the prior verdict stands; the open item is still the visual check of the Python tab in the PR preview."
}

Reviewed commit: 18d64d2

@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

💰 Cost: $0.2029 (review) — run

@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.2
🚀 Preview available at: https://Morrison-Lab.github.io/mds/pr-preview/pr-660/

Built to branch gh-pages at 2026-11-05 23:46 UTC.

d-morrison commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor Author

Annotations reviewed: 18d64d2. They are the Ubuntu 26 runner-label notices, the anonymous-submodule notice, a diff-highlighting cap notice, and one multiple-terms-in-definition warning on a definition div this PR does not touch (the PR changes a figure subfile and two py_require lists).

Posted by Claude Code (AI agent) --- not written by a human.


Generated by Claude Code

@d-morrison
d-morrison merged commit 784c16c into main Nov 5, 2026
45 checks passed
d-morrison added a commit that referenced this pull request Nov 6, 2026
* Draw four more Python 3D figures with plotly (batch 2)

Refs #664. Follows #660 and Morrison-Lab/psw#500: plotly for HTML and slides, matplotlib kept as the -static chunk for PDF and Word.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019xfc9pyVsdgfFPiYDQB7ko

* Request plotly in the contour-line figure's own requirements

The figure subfile declares its Python packages, so a page that includes it (algebra.qmd through _algebra.qmd, or an external host) gets plotly without its own py_require. Drops the page-level chunk that is now redundant.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019xfc9pyVsdgfFPiYDQB7ko

---------

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pilot plotly for the Python 3D figure of the second-order condition

2 participants